Expand description

Extensions for glutin to initialize & update old school gfx. An alternative to gfx_window_glutin.

Example

type ColorFormat = gfx::format::Srgba8;
type DepthFormat = gfx::format::DepthStencil;

let event_loop = winit::event_loop::EventLoop::new();
let window_builder = winit::window::WindowBuilder::new();

// Initialise winit window, glutin context & gfx views
let old_school_gfx_glutin_ext::Init {
    // winit window
    window,
    // glutin bits
    gl_config,
    gl_surface,
    gl_context,
    // gfx bits
    mut device,
    mut factory,
    mut color_view,
    mut depth_view,
    ..
} = old_school_gfx_glutin_ext::window_builder(&event_loop, window_builder)
    .build::<ColorFormat, DepthFormat>()?;

// Update gfx views, e.g. after a window resize
old_school_gfx_glutin_ext::resize_views(new_size, &mut color_view, &mut depth_view);

Structs

Builder for initialising a winit window, glutin context & gfx views.
Initialised winit, glutin & gfx state.

Enums

Functions

Recreate and replace gfx views if the dimensions have changed.
Return new gfx views if the dimensions have changed.
Return new gfx views if the dimensions have changed.
Returns a builder for initialising a winit window, glutin context & gfx views.

Type Definitions

Initialised winit, glutin & gfx state.
“Raw” initialised winit, glutin & gfx state.